package com.xuhuan.common.entity;

import java.util.HashMap;
import java.util.Map;

/**
 * @author huan.xu
 * @ClassName User
 * @date 2021/6/3 17:12
 * @Description 人员-实体
 */
public class User {

    private String name;
    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public static Map user2Map(User user) {
        Map map = new HashMap(2);
        map.put("name", user.getName());
        map.put("age", user.getAge());
        return map;
    }
}
